
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>测试 · Gitbook demo</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.2">
        <meta name="author" content="lanyue">
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="hot-reload.html" />
    
    
    <link rel="prev" href="forms.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" >
            
                <a target="_blank" href="https://github.com/vuejs/vuex/tree/1.0/docs">
            
                    
                    寻找 1.0 文档？
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" >
            
                <a target="_blank" href="https://github.com/vuejs/vuex/releases">
            
                    
                    更新记录
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="installation.html">
            
                <a href="installation.html">
            
                    
                    安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="intro.html">
            
                <a href="intro.html">
            
                    
                    Vuex 是什么？
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="getting-started.html">
            
                <a href="getting-started.html">
            
                    
                    开始
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7" >
            
                <span>
            
                    
                    核心概念
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="state.html">
            
                <a href="state.html">
            
                    
                    State
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="getters.html">
            
                <a href="getters.html">
            
                    
                    Getters
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="mutations.html">
            
                <a href="mutations.html">
            
                    
                    Mutations
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="actions.html">
            
                <a href="actions.html">
            
                    
                    Actions
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.5" data-path="modules.html">
            
                <a href="modules.html">
            
                    
                    Modules
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="structure.html">
            
                <a href="structure.html">
            
                    
                    项目结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="plugins.html">
            
                <a href="plugins.html">
            
                    
                    插件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="strict.html">
            
                <a href="strict.html">
            
                    
                    严格模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="forms.html">
            
                <a href="forms.html">
            
                    
                    表单处理
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.12" data-path="testing.html">
            
                <a href="testing.html">
            
                    
                    测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="hot-reload.html">
            
                <a href="hot-reload.html">
            
                    
                    热重载
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="api.html">
            
                <a href="api.html">
            
                    
                    API 文档
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >测试</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x6D4B;&#x8BD5;">&#x6D4B;&#x8BD5;</h1>
<p>&#x6211;&#x4EEC;&#x4E3B;&#x8981;&#x60F3;&#x9488;&#x5BF9; Vuex &#x4E2D;&#x7684; mutations &#x548C; actions &#x8FDB;&#x884C;&#x5355;&#x5143;&#x6D4B;&#x8BD5;&#x3002;</p>
<h3 id="&#x6D4B;&#x8BD5;-mutations">&#x6D4B;&#x8BD5; Mutations</h3>
<p>Mutations &#x5F88;&#x5BB9;&#x6613;&#x88AB;&#x6D4B;&#x8BD5;&#xFF0C;&#x56E0;&#x4E3A;&#x5B83;&#x4EEC;&#x4EC5;&#x4EC5;&#x662F;&#x4E00;&#x4E9B;&#x5B8C;&#x5168;&#x4F9D;&#x8D56;&#x53C2;&#x6570;&#x7684;&#x51FD;&#x6570;&#x3002;&#x8FD9;&#x91CC;&#x6709;&#x4E00;&#x4E2A;&#x5C0F;&#x6280;&#x5DE7;&#xFF0C;&#x5982;&#x679C;&#x4F60;&#x5728; <code>store.js</code> &#x6587;&#x4EF6;&#x4E2D;&#x5B9A;&#x4E49;&#x4E86; mutations&#xFF0C;&#x5E76;&#x4E14;&#x4F7F;&#x7528; ES2015 &#x6A21;&#x5757;&#x529F;&#x80FD;&#x9ED8;&#x8BA4;&#x8F93;&#x51FA;&#x4E86; Vuex.Store &#x7684;&#x5B9E;&#x4F8B;&#xFF0C;&#x90A3;&#x4E48;&#x4F60;&#x4ECD;&#x7136;&#x53EF;&#x4EE5;&#x7ED9; mutation &#x53D6;&#x4E2A;&#x53D8;&#x91CF;&#x540D;&#x7136;&#x540E;&#x628A;&#x5B83;&#x8F93;&#x51FA;&#x53BB;&#xFF1A;</p>
<pre><code class="lang-js"><span class="hljs-keyword">const</span> state = { ... }

<span class="hljs-comment">// mutations &#x4F5C;&#x4E3A;&#x547D;&#x540D;&#x8F93;&#x51FA;&#x5BF9;&#x8C61;</span>
<span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> mutations = { ... }

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-keyword">new</span> Vuex.Store({
  state,
  mutations
})
</code></pre>
<p>&#x4E0B;&#x9762;&#x662F;&#x7528; Mocha + Chai &#x6D4B;&#x8BD5;&#x4E00;&#x4E2A; mutation &#x7684;&#x4F8B;&#x5B50;&#xFF08;&#x5B9E;&#x9645;&#x4E0A;&#x4F60;&#x53EF;&#x4EE5;&#x7528;&#x4EFB;&#x4F55;&#x4F60;&#x559C;&#x6B22;&#x7684;&#x6D4B;&#x8BD5;&#x6846;&#x67B6;&#xFF09;&#xFF1A;</p>
<pre><code class="lang-js"><span class="hljs-comment">// mutations.js</span>
<span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> mutations = {
  increment: state =&gt; state.count++
}
</code></pre>
<pre><code class="lang-js"><span class="hljs-comment">// mutations.spec.js</span>
<span class="hljs-keyword">import</span> { expect } <span class="hljs-keyword">from</span> <span class="hljs-string">&apos;chai&apos;</span>
<span class="hljs-keyword">import</span> { mutations } <span class="hljs-keyword">from</span> <span class="hljs-string">&apos;./store&apos;</span>

<span class="hljs-comment">// &#x89E3;&#x6784; mutations</span>
<span class="hljs-keyword">const</span> { increment } = mutations

describe(<span class="hljs-string">&apos;mutations&apos;</span>, () =&gt; {
  it(<span class="hljs-string">&apos;INCREMENT&apos;</span>, () =&gt; {
    <span class="hljs-comment">// &#x6A21;&#x62DF;&#x72B6;&#x6001;</span>
    <span class="hljs-keyword">const</span> state = { count: <span class="hljs-number">0</span> }
    <span class="hljs-comment">// &#x5E94;&#x7528; mutation</span>
    increment(state)
    <span class="hljs-comment">// &#x65AD;&#x8A00;&#x7ED3;&#x679C;</span>
    expect(state.count).to.equal(<span class="hljs-number">1</span>)
  })
})
</code></pre>
<h3 id="&#x6D4B;&#x8BD5;-actions">&#x6D4B;&#x8BD5; Actions</h3>
<p>Actions &#x5E94;&#x5BF9;&#x8D77;&#x6765;&#x7565;&#x5FAE;&#x68D8;&#x624B;&#xFF0C;&#x56E0;&#x4E3A;&#x5B83;&#x4EEC;&#x53EF;&#x80FD;&#x9700;&#x8981;&#x8C03;&#x7528;&#x5916;&#x90E8;&#x7684; API&#x3002;&#x5F53;&#x6D4B;&#x8BD5; actions &#x7684;&#x65F6;&#x5019;&#xFF0C;&#x6211;&#x4EEC;&#x9700;&#x8981;&#x589E;&#x52A0;&#x4E00;&#x4E2A; mocking &#x670D;&#x52A1;&#x5C42; &#x2014;&#x2014; &#x4F8B;&#x5982;&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x628A; API &#x8C03;&#x7528;&#x62BD;&#x8C61;&#x6210;&#x670D;&#x52A1;&#xFF0C;&#x7136;&#x540E;&#x5728;&#x6D4B;&#x8BD5;&#x6587;&#x4EF6;&#x4E2D;&#x7528; mock &#x670D;&#x52A1;&#x56DE;&#x5E94; API &#x8C03;&#x7528;&#x3002;&#x4E3A;&#x4E86;&#x4FBF;&#x4E8E;&#x89E3;&#x51B3; mock &#x4F9D;&#x8D56;&#xFF0C;&#x53EF;&#x4EE5;&#x7528; Webpack &#x548C;  <a href="https://github.com/plasticine/inject-loader" target="_blank">inject-loader</a> &#x6253;&#x5305;&#x6D4B;&#x8BD5;&#x6587;&#x4EF6;&#x3002;</p>
<p>&#x4E0B;&#x9762;&#x662F;&#x4E00;&#x4E2A;&#x6D4B;&#x8BD5;&#x5F02;&#x6B65; action &#x7684;&#x4F8B;&#x5B50;&#xFF1A;</p>
<pre><code class="lang-js"><span class="hljs-comment">// actions.js</span>
<span class="hljs-keyword">import</span> shop <span class="hljs-keyword">from</span> <span class="hljs-string">&apos;../api/shop&apos;</span>

<span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> getAllProducts = ({ commit }) =&gt; {
  commit(<span class="hljs-string">&apos;REQUEST_PRODUCTS&apos;</span>)
  shop.getProducts(products =&gt; {
    commit(<span class="hljs-string">&apos;RECEIVE_PRODUCTS&apos;</span>, products)
  })
}
</code></pre>
<pre><code class="lang-js"><span class="hljs-comment">// actions.spec.js</span>

<span class="hljs-comment">// &#x4F7F;&#x7528; require &#x8BED;&#x6CD5;&#x5904;&#x7406;&#x5185;&#x8054; loaders&#x3002;</span>
<span class="hljs-comment">// inject-loader &#x8FD4;&#x56DE;&#x4E00;&#x4E2A;&#x5141;&#x8BB8;&#x6211;&#x4EEC;&#x6CE8;&#x5165; mock &#x4F9D;&#x8D56;&#x7684;&#x6A21;&#x5757;&#x5DE5;&#x5382;</span>
<span class="hljs-keyword">import</span> { expect } <span class="hljs-keyword">from</span> <span class="hljs-string">&apos;chai&apos;</span>
<span class="hljs-keyword">const</span> actionsInjector = <span class="hljs-built_in">require</span>(<span class="hljs-string">&apos;inject!./actions&apos;</span>)

<span class="hljs-comment">// &#x4F7F;&#x7528; mocks &#x521B;&#x5EFA;&#x6A21;&#x5757;</span>
<span class="hljs-keyword">const</span> actions = actionsInjector({
  <span class="hljs-string">&apos;../api/shop&apos;</span>: {
    getProducts (cb) {
      setTimeout(() =&gt; {
        cb([ <span class="hljs-comment">/* mocked response */</span> ])
      }, <span class="hljs-number">100</span>)
    }
  }
})

<span class="hljs-comment">// &#x7528;&#x6307;&#x5B9A;&#x7684; mutaions &#x6D4B;&#x8BD5; action &#x7684;&#x8F85;&#x52A9;&#x51FD;&#x6570;</span>
<span class="hljs-keyword">const</span> testAction = (action, args, state, expectedMutations, done) =&gt; {
  <span class="hljs-keyword">let</span> count = <span class="hljs-number">0</span>

  <span class="hljs-comment">// &#x6A21;&#x62DF;&#x63D0;&#x4EA4;</span>
  <span class="hljs-keyword">const</span> commit = (type, payload) =&gt; {
    <span class="hljs-keyword">const</span> mutation = expectedMutations[count]
    expect(mutation.type).to.equal(type)
    <span class="hljs-keyword">if</span> (payload) {
      expect(mutation.payload).to.deep.equal(payload)
    }
    count++
    <span class="hljs-keyword">if</span> (count &gt;= expectedMutations.length) {
      done()
    }
  }

  <span class="hljs-comment">// &#x7528;&#x6A21;&#x62DF;&#x7684; store &#x548C;&#x53C2;&#x6570;&#x8C03;&#x7528; action</span>
  action({ commit, state }, ...args)

  <span class="hljs-comment">// &#x68C0;&#x67E5;&#x662F;&#x5426;&#x6CA1;&#x6709; mutation &#x88AB; dispatch</span>
  <span class="hljs-keyword">if</span> (expectedMutations.length === <span class="hljs-number">0</span>) {
    expect(count).to.equal(<span class="hljs-number">0</span>)
    done()
  }
}

describe(<span class="hljs-string">&apos;actions&apos;</span>, () =&gt; {
  it(<span class="hljs-string">&apos;getAllProducts&apos;</span>, done =&gt; {
    testAction(actions.getAllProducts, [], {}, [
      { type: <span class="hljs-string">&apos;REQUEST_PRODUCTS&apos;</span> },
      { type: <span class="hljs-string">&apos;RECEIVE_PRODUCTS&apos;</span>, payload: { <span class="hljs-comment">/* mocked response */</span> } }
    ], done)
  })
})
</code></pre>
<h3 id="&#x6D4B;&#x8BD5;-getters">&#x6D4B;&#x8BD5; Getters</h3>
<p>&#x5982;&#x679C;&#x4F60;&#x7684; getter &#x5305;&#x542B;&#x5F88;&#x590D;&#x6742;&#x7684;&#x8BA1;&#x7B97;&#x8FC7;&#x7A0B;&#xFF0C;&#x5F88;&#x6709;&#x5FC5;&#x8981;&#x6D4B;&#x8BD5;&#x5B83;&#x4EEC;&#x3002;Getter &#x7684;&#x6D4B;&#x8BD5;&#x4E0E; mutation &#x4E00;&#x6837;&#x76F4;&#x622A;&#x4E86;&#x5F53;&#x3002;</p>
<p>&#x6D4B;&#x8BD5;&#x4E00;&#x4E2A; getter &#x7684;&#x793A;&#x4F8B;&#xFF1A;</p>
<pre><code class="lang-js"><span class="hljs-comment">// getters.js</span>
<span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> getters = {
  filteredProducts (state, { filterCategory }) {
    <span class="hljs-keyword">return</span> state.products.filter(product =&gt; {
      <span class="hljs-keyword">return</span> product.category === filterCategory
    })
  }
}
</code></pre>
<pre><code class="lang-js"><span class="hljs-comment">// getters.spec.js</span>
<span class="hljs-keyword">import</span> { expect } <span class="hljs-keyword">from</span> <span class="hljs-string">&apos;chai&apos;</span>
<span class="hljs-keyword">import</span> { getters } <span class="hljs-keyword">from</span> <span class="hljs-string">&apos;./getters&apos;</span>

describe(<span class="hljs-string">&apos;getters&apos;</span>, () =&gt; {
  it(<span class="hljs-string">&apos;filteredProducts&apos;</span>, () =&gt; {
    <span class="hljs-comment">// &#x6A21;&#x62DF;&#x72B6;&#x6001;</span>
    <span class="hljs-keyword">const</span> state = {
      products: [
        { id: <span class="hljs-number">1</span>, title: <span class="hljs-string">&apos;Apple&apos;</span>, category: <span class="hljs-string">&apos;fruit&apos;</span> },
        { id: <span class="hljs-number">2</span>, title: <span class="hljs-string">&apos;Orange&apos;</span>, category: <span class="hljs-string">&apos;fruit&apos;</span> },
        { id: <span class="hljs-number">3</span>, title: <span class="hljs-string">&apos;Carrot&apos;</span>, category: <span class="hljs-string">&apos;vegetable&apos;</span> }
      ]
    }
    <span class="hljs-comment">// &#x6A21;&#x62DF; getter</span>
    <span class="hljs-keyword">const</span> filterCategory = <span class="hljs-string">&apos;fruit&apos;</span>

    <span class="hljs-comment">// &#x83B7;&#x53D6; getter &#x7684;&#x7ED3;&#x679C;</span>
    <span class="hljs-keyword">const</span> result = getters.filteredProducts(state, { filterCategory })

    <span class="hljs-comment">// &#x65AD;&#x8A00;&#x7ED3;&#x679C;</span>
    expect(result).to.deep.equal([
      { id: <span class="hljs-number">1</span>, title: <span class="hljs-string">&apos;Apple&apos;</span>, category: <span class="hljs-string">&apos;fruit&apos;</span> },
      { id: <span class="hljs-number">2</span>, title: <span class="hljs-string">&apos;Orange&apos;</span>, category: <span class="hljs-string">&apos;fruit&apos;</span> }
    ])
  })
})
</code></pre>
<h3 id="&#x6267;&#x884C;&#x6D4B;&#x8BD5;">&#x6267;&#x884C;&#x6D4B;&#x8BD5;</h3>
<p>&#x5982;&#x679C;&#x4F60;&#x7684; mutations &#x548C; actions &#x7F16;&#x5199;&#x6B63;&#x786E;&#xFF0C;&#x7ECF;&#x8FC7;&#x5408;&#x7406;&#x5730; mocking &#x5904;&#x7406;&#x4E4B;&#x540E;&#x8FD9;&#x4E9B;&#x6D4B;&#x8BD5;&#x5E94;&#x8BE5;&#x4E0D;&#x4F9D;&#x8D56;&#x4EFB;&#x4F55;&#x6D4F;&#x89C8;&#x5668; API&#xFF0C;&#x56E0;&#x6B64;&#x4F60;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x7528; Webpack &#x6253;&#x5305;&#x8FD9;&#x4E9B;&#x6D4B;&#x8BD5;&#x6587;&#x4EF6;&#x7136;&#x540E;&#x5728; Node &#x4E2D;&#x6267;&#x884C;&#x3002;&#x6362;&#x79CD;&#x65B9;&#x5F0F;&#xFF0C;&#x4F60;&#x4E5F;&#x53EF;&#x4EE5;&#x7528; <code>mocha-loader</code> &#x6216; <code>Karma</code> + <code>karma-webpack</code>&#x5728;&#x771F;&#x5B9E;&#x6D4F;&#x89C8;&#x5668;&#x73AF;&#x5883;&#x4E2D;&#x8FDB;&#x884C;&#x6D4B;&#x8BD5;&#x3002;</p>
<h4 id="&#x5728;-node-&#x4E2D;&#x6267;&#x884C;&#x6D4B;&#x8BD5;">&#x5728; Node &#x4E2D;&#x6267;&#x884C;&#x6D4B;&#x8BD5;</h4>
<p>&#x521B;&#x5EFA;&#x4EE5;&#x4E0B; webpack &#x914D;&#x7F6E;&#xFF08;&#x914D;&#x7F6E;&#x597D; <a href="https://babeljs.io/docs/usage/babelrc/" target="_blank"><code>.babelrc</code></a>&#xFF09;:</p>
<pre><code class="lang-js"><span class="hljs-comment">// webpack.config.js</span>
<span class="hljs-built_in">module</span>.exports = {
  entry: <span class="hljs-string">&apos;./test.js&apos;</span>,
  output: {
    path: __dirname,
    filename: <span class="hljs-string">&apos;test-bundle.js&apos;</span>
  },
  <span class="hljs-built_in">module</span>: {
    loaders: [
      {
        test: <span class="hljs-regexp">/\.js$/</span>,
        loader: <span class="hljs-string">&apos;babel&apos;</span>,
        exclude: <span class="hljs-regexp">/node_modules/</span>
      }
    ]
  }
}
</code></pre>
<p>&#x7136;&#x540E;&#xFF1A;</p>
<pre><code class="lang-bash">webpack
mocha <span class="hljs-built_in">test</span>-bundle.js
</code></pre>
<h4 id="&#x5728;&#x6D4F;&#x89C8;&#x5668;&#x4E2D;&#x6D4B;&#x8BD5;">&#x5728;&#x6D4F;&#x89C8;&#x5668;&#x4E2D;&#x6D4B;&#x8BD5;</h4>
<ol>
<li>&#x5B89;&#x88C5; <code>mocha-loader</code></li>
<li>&#x628A;&#x4E0A;&#x8FF0; webpack &#x914D;&#x7F6E;&#x4E2D;&#x7684; <code>entry</code> &#x6539;&#x6210; <code>&apos;mocha!babel!./test.js&apos;</code></li>
<li>&#x7528;&#x4EE5;&#x4E0A;&#x914D;&#x7F6E;&#x542F;&#x52A8; <code>webpack-dev-server</code></li>
<li>&#x8BBF;&#x95EE; <code>localhost:8080/webpack-dev-server/test-bundle</code>.</li>
</ol>
<h4 id="&#x4F7F;&#x7528;-karma--karma-webpack-&#x5728;&#x6D4F;&#x89C8;&#x5668;&#x4E2D;&#x6267;&#x884C;&#x6D4B;&#x8BD5;">&#x4F7F;&#x7528; Karma + karma-webpack &#x5728;&#x6D4F;&#x89C8;&#x5668;&#x4E2D;&#x6267;&#x884C;&#x6D4B;&#x8BD5;</h4>
<p>&#x8BE6;&#x89C1; <a href="http://vuejs.github.io/vue-loader/workflow/testing.html" target="_blank">vue-loader documentation</a>&#x3002;</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="forms.html" class="navigation navigation-prev " aria-label="Previous page: 表单处理">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="hot-reload.html" class="navigation navigation-next " aria-label="Next page: 热重载">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"测试","level":"1.12","depth":1,"next":{"title":"热重载","level":"1.13","depth":1,"path":"hot-reload.md","ref":"hot-reload.md","articles":[]},"previous":{"title":"表单处理","level":"1.11","depth":1,"path":"forms.md","ref":"forms.md","articles":[]},"dir":"ltr"},"config":{"plugins":[],"root":"./","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"lanyue","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Gitbook demo","language":"zh-hans","gitbook":">=3.0.0","description":"this is a test"},"file":{"path":"testing.md","mtime":"2017-02-21T09:41:56.412Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2017-03-06T15:58:45.473Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

